<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head></head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css">
    *{
        margin: 0px;
        padding: 0px;
        }
    .maxBox{
        width: 1000px;
        margin:auto;
        height:auto;
        margin-top:0px;

        }
    .td_height{
        height:24px;
        }
    .data{
        text-align: right;
        width: 80px;
        }
    .data_td{
        width: 130px;
        text-align: left;
        }
    .table1 tr td{ text-align:center;border:1px solid #000;}
</style>
<body>
<div class="maxBox">
    <?php foreach($results as $_result){?>
        <h3 style="font-size:24px;text-align: center;">有棵树科技产品质检报告单</h3>
        <table summary="" style="float:right;margin-bottom:5px;" >
            <tr>
                <td class="data">日期：</td>
                <td class="data_td"><?php echo date('Y-m-d'); ?></td>
            </tr>
            <tr>
                <td class="data">凭证单号：</td>
                <td class="data_td"><?php if(isset($_result['code'])){ echo $_result['code']; }else{ echo $_result['evidence'];} ?></td>
            </tr>
        </table>
        <?php
        $result=$_result['result'];
        $num = count($result);
        $j=0;
        $k=0;//当订单有七八十来个的时候，$k>1的时候就的加分页
        $counter=intval($num/5);
        for($i=0;$i<=$counter;$i++){

            if((!isset($result[$j]['purchaseorder_id']))||$result[$j]['purchaseorder_id']==''){
                if($i==$counter){?>
                    <div style="overflow:hidden;">
                        <span style="float:left;margin-right:10px;margin-top:10px; margin-left:200px;">审核人:</span>
                        <span style="float:right; margin-right:180px; margin-top:10px;">
			经办人:  <?php echo $_result['username'];?>  </span></div>
                <?php }
                continue;
            }?>
            <?php if($num>5&&$k>0){?><div style="page-break-after:always;"></div><?php }?>
            <table class="table1" border="1" cellSpacing="1"  style="margin-top:5px;font-size:18px;border-collapse:collapse;" cellpadding="0" cellspacing="0" width="1000px">
                <tr>
                    <td class="td_height">序号</td>
                    <td class="td_height" style="width:120px;">VMI预约单号</td>
                    <td class="td_height" style="width:65px;">计划员</td>
                    <td class="td_height">SKU</td>
                    <td class="td_height">中文名称</td>
                    <td class="td_height" style="width:80px;">到货数量</td>
                    <td class="td_height" style="width:80px;">入库数量</td>
                    <td class="td_height" style="width:100px;">不合格数量</td>
                    <td class="td_height">问题原因</td>
                    <td class="td_height">备注</td>
                </tr>
                <?php	for($z=0;$z<5;$z++){if((!isset($result[$j]['purchaseorder_id']))||$result[$j]['purchaseorder_id']=='')continue;?>
                    <tr>
                        <td class="td_height"><?php echo $j+1; ?></td>
                        <td><?php echo $result[$j]['purchaseorder_id']; ?></td>
                        <td><?php echo $result[$j]['check_man']; ?></td>
                        <td><?php echo $result[$j]['sku']; ?></td>
                        <td><?php echo $result[$j]['sku_name']; ?></td>
                        <td><?php echo $result[$j]['check_quantity']; ?></td>
                        <td><?php echo $result[$j]['qualified_quantity']; ?></td>
                        <td><?php echo $result[$j]['unquality_count'];?></td>
                        <td><?php echo $result[$j]['remark']; ?></td>
                        <td><?php echo $puOrdRemarks[$result[$j]['purchaseorder_id']]; ?></td>
                    </tr>
                    <?php $j++;}?>
            </table>
            <?php if($i==$counter){?><div style="overflow:hidden;">
                <span style="float:left;margin-right:10px;margin-top:10px; margin-left:200px;">审核人:</span>
                <span style="float:right; margin-right:180px; margin-top:10px;">
	经办人:  <?php echo $_result['username'];?>  </span></div><?php }?>

            <?php $k++;}?>
        <div style="page-break-after:always;"></div>
        <!--<div class="PageNext"></div>-->
    <?php }?>
</div>
</body>
</html>
